import axios from './http'
import Qs from "qs"


const job = {
    addJobConfig(params){
        return axios({
            url: '/api/job/saveJobConfig/', 
            method: 'post',
            data: Qs.stringify(params),
            headers: {
                'Content-Type':'application/x-www-form-urlencoded'
            }
        })
    },
    passwordEncode(params){
        return axios({
            url: '/api/job/passwordEncode/', 
            method: 'post',
            data: Qs.stringify(params),
            headers: {
                'Content-Type':'application/x-www-form-urlencoded'
            }
        })
    },
    operateJob(params){
        return axios({
            url: '/api/job/operate_job/', 
            method: 'post',
            data: Qs.stringify(params),
            headers: {
                'Content-Type':'application/x-www-form-urlencoded'
            }
        })
    },
    modifyJobStaus(params){
        return axios.get('/api/job/modifyJobStaus/', {params})
    },
    deleteJobConfig(params){
        return axios.get('/api/job/deleteJobConfig/', {params})
    },
    runJob(params){
        return axios.get('/api/job/start_job/', {params})
    },
    getJobConfig(params){
        return axios.get('/api/job/queryJobConfig/', {params})
    },
    queryFuncParams(params){
        return axios.get('/api/job/queryFuncParams/', {params})
    },
    queryLinkInfo(params){
        return axios.get('/api/job/linkInfo/', {params})
    },
    queryGroupNames(params){
        return axios.get('/api/job/getGroupNames/', {params})
    },

    submitLink(params){
        return axios({
            url: '/api/job/linkInfo/',
            method: 'post',
            data: Qs.stringify(params),
            headers: {
                'Content-Type':'application/x-www-form-urlencoded'
            }
        })
    }
}

export default job;